package com.bw.service.impl;

import java.util.List;

import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Service;

import com.bw.dao.NewsMapper;
import com.bw.entity.News;
import com.bw.service.NewsService;

@Service(value = "newsService")
public class NewsServiceImpl implements NewsService {

    @Autowired
    private NewsMapper<News>newsMapper;
    
    @Override
    public Integer insertSelective(News news) throws Exception {
           return this.newsMapper.insertSelective(news);
        }

    @Override
    public Integer insertBatch(List<News> news) throws Exception {
           return this.newsMapper.insertBatch(news) ;
        }

    @Override
    public Integer deleteByPrimaryKey(Object id) {
            return this.newsMapper.deleteByPrimaryKey(id);
    }

    public Integer deleteBatchByPrimaryKey(List<Object> ids) {
           return this.newsMapper.deleteBatchByPrimaryKey(ids);
    }

    @Override
    public Integer updateByPrimaryKeySelective(News news) {
           return this.newsMapper.updateByPrimaryKeySelective(news);
    }

    @Override
    public News findById(Object id) {
           return (News) this.newsMapper.selectByPrimaryKey(id);
    }

    @Override
    public List<News> selectByCondition(News news) {
           return (List<News>) this.newsMapper.selectByCondition(news);
    }

    @Override
    public Integer selectCountByCondition(News news) {
           return  this.newsMapper.selectCountByCondition(news);
    }

}
